/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"615BC7EE-B4DB-4866-B78C-708D29CF450A"}
 */
var pass = null;

/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"D431A2FA-6447-4D4B-89EA-D63462AF60BA"}
 */
var pass2 = null;

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"5CB47E97-A384-4167-B80D-A77883007A66"}
 * @AllowToRunInFind
 */
function grabar(event) {
	if (pass == pass2)
	{
		hash_pass = globals.hashPass(pass)
		pass = null
		pass2 = null
		databaseManager.saveData()
		globals.DIALOGS.showInfoDialog('Exito','Usuario creado exitosamente','OK')
		databaseManager.setAutoSave(true)
		forms.main.controller.show()		
	}
	else
	{
		pass = null
		pass2 = null
		globals.DIALOGS.showWarningDialog('Error','Verificacion de contraseña fallo','OK')
	}	
}

/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"01AEE256-52F5-4338-8F4B-C080D3576F09"}
 */
function onShowForm(firstShow, event) {
	databaseManager.setAutoSave(false)
	controller.newRecord()
	userv_id = globals.gUsrID
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"7F35A397-1408-41BC-9A80-2FB07FD4C7D3"}
 */
function cancelar(event) {
	databaseManager.revertEditedRecords()
	databaseManager.setAutoSave(true)
	forms.main.controller.show()
}
